package com.mjlf.framework.aop;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * @auther a123
 * @create 2018-08-29 17:51
 * @desc 增强方法属性类
 */
public class AdviseMethod {
    private Annotation adviceAnnotation;
    private Method method;
    private Object object;
    private Class<?>[] argsType;
    private String[] argsName;
    private Class<?> returnType;
    private String returnName;

    public AdviseMethod() {
    }

    public AdviseMethod(Annotation adviceAnnotation, Method method, Object object) {
        this.adviceAnnotation = adviceAnnotation;
        this.method = method;
        this.object = object;
    }

    public Method getMethod() {
        return method;
    }

    public Object getObject() {
        return object;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public Class<?>[] getArgsType() {
        return argsType;
    }

    public void setArgsType(Class<?>[] argsType) {
        this.argsType = argsType;
    }

    public String[] getArgsName() {
        return argsName;
    }

    public void setArgsName(String[] argsName) {
        this.argsName = argsName;
    }

    public Class<?> getReturnType() {
        return returnType;
    }

    public void setReturnType(Class<?> returnType) {
        this.returnType = returnType;
    }

    public String getReturnName() {
        return returnName;
    }

    public void setReturnName(String returnName) {
        this.returnName = returnName;
    }

    public Annotation getAdviceAnnotation() {
        return adviceAnnotation;
    }

    public void setAdviceAnnotation(Annotation adviceAnnotation) {
        this.adviceAnnotation = adviceAnnotation;
    }

    @Override
    public String toString() {
        return "AdviseMethod{" +
                "adviceAnnotation=" + adviceAnnotation +
                ", method=" + method +
                ", object=" + object +
                ", argsType=" + Arrays.toString(argsType) +
                ", argsName=" + Arrays.toString(argsName) +
                ", returnType=" + returnType +
                ", returnName='" + returnName + '\'' +
                '}';
    }
}
